Skip to content

cam_hal: add guard in cam_task() so DMA transfers cannot exceed image slot size #772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RubenKelevra
Copy link
Contributor

Description

Previously there is no limit how much data would be transferred via DMA from the camera (in psram_mode).

Added a DMA overflow detection block in cam_task() so the driver stops if the number of frame copies exceeds the is reaching the maximum amount of storage allocated in PSRAM.

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@me-no-dev
Copy link
Member

have you been able to confirm such issue?

@RubenKelevra
Copy link
Contributor Author

No, because another bug currently blocks the usage for me. I'm working on a fix for that.

But since we just guess the slot size of the image, based on the settings rather than observations, and it can be overwritten by build flags IIRC, it's a reasonable guard to prevent more than copy operations than we got space.

… slot size

Previously there is no limit how much data would be transferred
via DMA from the camera.

Added a DMA overflow detection block in cam_task() so the
driver stops if the number of frame copies exceeds the
is reaching the maximum amount of storage allocated in
PSRAM.
@RubenKelevra RubenKelevra force-pushed the bugfix/camtask_dma_overflow_detection branch from 54e0438 to 309999a Compare July 18, 2025 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants